package com.imooc.distributedemo.resume.thread;

/**
 * 判断线程是否存活
 */
public class ThreadAliveDemo {

    public static void main(String[] args) throws InterruptedException{
        Thread t1 = new Thread(()->{
            System.out.println("t1 begin");
            try{
                Thread.sleep(1000);
            }catch (Exception e){
                e.printStackTrace();
            }
            System.out.println("t1 end");
        });
        t1.start();
        System.out.println("---"+t1.isAlive());
        t1.join();
        System.out.println("==="+t1.isAlive());


    }

}
